package com.gxuwz.medical.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import com.gxuwz.medical.domain.medical.S201;

public class S201Dao extends GenericDao<S201>{
	@Override
	protected S201 handle(ResultSet rs) throws SQLException {
		S201 s=new S201();
		s.setId(rs.getInt("id"));
		s.setItemcode(rs.getString("itemcode"));
		s.setItemname(rs.getString("itemname"));
		s.setType(rs.getString("type"));
		return s;
	}
	public S201 query(String itemcode,String type)throws SQLException{
		String sql = "select * from S201 where itemcode = ? and type = ?";
		Object[] params = {itemcode,type};
		return super.queryAll(sql, params).get(0);
	}
	public List<S201> queryListByType(String type) throws SQLException{
		String sql = "select * from S201 where type = ?";
		Object[] params = {type};
		return super.queryAll(sql, params);
	}
	
}
